<?php
namespace app\wenchuang\validate;

use think\Validate;

class NavValidate extends Validate
{
    // 定义验证规则
    protected $rule = [
        'name' => 'require',
        'url' => 'require',
        'id' => 'require'
    ];

    // 定义提示信息
    protected $message = [
        'name.require' => '菜单名称不能为空',
        'url.require' => '跳转链接不能为空',
        'id.require' => '数据错误，缺少 id ！',
    ];

    // 验证场景
    protected $scene = [
        'add' => ['name', 'url'],
        'edit' => ['name', 'url', 'id']
    ];
}
